#include<bits/stdc++.h>

using namespace std;

const int MAXN = 3e5+10;

typedef long long ll;

int t[MAXN],c[MAXN],n,s,q[MAXN];
ll st[MAXN],sc[MAXN],f[MAXN];

int sear(int l,int r,ll val){
	int R = r;
	r = r-1;int ans = -1;
	while(l <= r){
		int mid = l+r>>1;
		if((f[q[mid+1]] - s * sc[q[mid+1]] - f[q[mid]] + s * sc[q[mid]]) > (sc[q[mid+1]] - sc[q[mid]]) * val) ans = mid,r = mid-1;
		else l = mid+1;
	}
	if(ans == -1) return q[R];
	return q[ans];
}

int main (){
	scanf("%d %d",&n,&s);
	for(int i = 1;i <= n;i++) {
		scanf("%d %d",&t[i],&c[i]);
		st[i] = st[i-1] + t[i];
		sc[i] = sc[i-1] + c[i];
	}
	int l = 1, r = 1;f[0] = 0;
	for(int i = 1;i <= n;i++){
		int pos = sear(l,r,st[i]);
		f[i] = f[pos] + st[i] * (sc [i] - sc[pos]) + s * (sc[n] - sc[pos]);
		while(l < r && (f[i] - s * sc[i] - f[q[r]] + s * sc[q[r]]) * (sc[q[r]] - sc[q[r-1]]) <= (f[q[r]] - s * sc[q[r]] - f[q[r-1]] + s * sc[q[r-1]]) * (sc[i] - sc[q[r]])) r--;
		q[++r] = i;
	}
	printf("%lld\n",f[n]);
	return 0;
}
